<script type="text/javascript">
<!--
{literal}
    $(document).ready(function() {
        $('#reportResultTbl tbody tr:last').addClass('last');
    });
{/literal}
//-->
</script>
<div align="center">
    <!-- Title  -->
    <div style="margin-top: 5px;" align="center"> 
        <div class="field-row">
            <span class="report-tittle">{$name}</span>
        </div>
        <div class="field-row">
            <span style="font-size: 16px; text-align: center;">{translate}Date{/translate}: <b>{$date}</b></span>
        </div>
        <div style="clear: both;"></div>
    </div>
    
    <!-- Report result -->
    <div style="margin-top: 10px; width: 100%;" align="center">
        <!-- Detailed list -->
        <div style="width: 100%;">
            <div>
            <table id="reportResultTbl" class="grid-report" cellpadding="0" cellspacing="0" style="width: 800px;">
                <thead>
                    <tr>
                        <th  class="first" style="width: 30px; text-align: left">{translate}No.{/translate}</th>
                        <th style="width: 80px;">{translate}Patient's ID_1{/translate}</th>
                        <th>{translate}Full name{/translate}</th>
                        <th style="width: 100px;">{translate}Price{/translate}</th>
                        <th style="width: 100px;">{translate}Insurance payment{/translate}</th>
                        <th style="width: 100px;">{translate}Patient payment{/translate}</th>
                        <th class='last' style="width: 100px;">{translate}Real payment{/translate}</th>
                    </tr>
                </thead>
                <tbody>
                    {if $itemNumber > 0}
                    {foreach from=$reportModel->getItemList() item=paymentItem}
                        <tr>
                            <td class='order first field-number'>{$index++}</td>
                            <td>{$paymentItem->getPatientCode()}</td>
                            <td>{$paymentItem->getPatientName()}</td>
                            <td class="field-number">{$paymentItem->getLocalizedNumber('original_price')}</td>
                            <td class="field-number">{$paymentItem->getLocalizedNumber('insurance_price')}</td>
                            <td class="field-number">{$paymentItem->getLocalizedNumber('patient_price')}</td>
                            <td class='last field-number'>{$paymentItem->getLocalizedNumber('real_payment')}</td>
                        </tr>
                    {/foreach}
                        <tr>
                            <td colspan="2" class="first">&nbsp;</td>
                            <td class="total-label">{translate}Grand total{/translate}</td>
                            <td class="total-value field-number"><span class='total-value'>{$total.original_price}</span></td>
                            <td class="total-value field-number"><span class='total-value'>{$total.insurance_price}</span></td>
                            <td class="total-value field-number"><span class='total-value'>{$total.patient_price}</span></td>
                            <td class="last field-number"><span class='total-value'>{$total.real_payment}</span></td>
                        </tr>
                    {else}  
                        <tr><td colspan="7" align="left"  class='first last'>{translate}The report has no results{/translate}</td></tr>
                    {/if}    
                </tbody>
            </table>
            </div>
        </div>      
    </div>
</div>